package day03;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
 *文件名: Student
 *创建者:
 *创建时间:2025/5/21 09:54
 *描述:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Comparable<Student>{
    private String name;
    private int age;

    @Override
    public int compareTo(Student o) {
        //按学生年龄正序排序
        return this.age -o.getAge();

    }
}
